#include <stdio.h>
#include <stdlib.h>

int un_g_val;
int g_val = 100;

int main()
{
    printf("text: %p\n", main); //代码区地址
    printf("init: %p\n", &g_val); //已初始化全局数据区
    printf("uninit: %p\n", &un_g_val); //未初始化全局数据区
    
    char* p1 = (char*)malloc(16);
    char* p2 = (char*)malloc(16);
    char* p3 = (char*)malloc(16);
    
    printf("heap: %p\n", p1); //堆地址
    printf("heap: %p\n", p2);
    printf("heap: %p\n", p3);
    printf("stack: %p\n", &p1); //栈地址
    printf("stack: %p\n", &p2);
    printf("stack: %p\n", &p3);
        
    return 0;
}


